import BaseModel from './base.model';

export const tableName = 'xhs_user';
export interface ITableStructure {
  user_id?: string,
  nick_name?: string, // 昵称
  status?: number,    //执行状态 0 未执行  1 是正在执行
  message_status?:number, //是否发送过消息
  message_time?: string,  //信息发送时间
  create_time?: string,  //导入时间
};

export class xhsUserModel extends BaseModel<ITableStructure> {

  constructor() {
    super({ tableName });
  }

  async getXhsUserAppList(filters: Partial<ITableStructure>) {
    return this.$db.table(tableName).where(filters).limit(5).select();
  }

  async updateUserStatus(xhs_user_id: string, status: number) {
    return this.$db.table(tableName).where({ xhs_user_id }).update({ status });
  }
  
}

export default new xhsUserModel();

